/**
 * Copyright (c) 2016-2019 人人开源 All rights reserved.
 *
 * https://www.renren.io
 *
 * 版权所有，侵权必究！
 */

package io.bsly.modules.sys.controller;

import io.bsly.common.utils.PageUtils;
import io.bsly.common.utils.R;
import io.bsly.modules.app.service.localmaster.SysLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Map;


/**
 * 系统日志
 *
 * @author Mark sunlightcs@gmail.com
 */
@Api(tags = "后台系统日志")
@RestController
@RequestMapping("/sys/log")
public class SysLogController {
	@Autowired
	private SysLogService sysLogService;
	
	/**
	 * 列表
	 */
	@ApiOperation(value = "分页",notes = "分页")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "username",value = "用户名" , dataType = "string", paramType = "query"),
			@ApiImplicitParam(name = "operation",value = "操作名称，如：审核核销码" , dataType = "string", paramType = "query"),
			@ApiImplicitParam(name = "opDate",value = "操作日期," , dataType = "string", paramType = "query",example = "2020-12-20"),
			@ApiImplicitParam(name = "page",value = "当前页数" , dataType = "int", paramType = "query"),
			@ApiImplicitParam(name = "limit",value = "每页条数" , dataType = "int", paramType = "query")
	})
	@ResponseBody
	@GetMapping("/list")
	public R list(@RequestParam Map<String, Object> params){
		PageUtils page = sysLogService.queryPage(params);
		return R.ok().put("page", page);
	}
	
}
